#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[]) {
    int opt;
    int num = 0;

    while ((opt = getopt(argc, argv, "w:")) != -1) {
        switch (opt) {
            case 'w':
                if (optarg != NULL) {
                    num = atoi(optarg);
                    printf("Option -w followed by a number: %d\n", num);
                } else {
                    printf("Option -w without a number\n");
                }
                break;
            default:
                return 0;
        }
    }

    return 0;
}

